{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport classNames from 'classnames';\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport React, { useContext, useRef } from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport { cloneElement } from '../reactNode';\nimport useStyle from './style';\nimport useWave from './useWave';\nvar Wave = function Wave(props) {\n  var children = props.children,\n    disabled = props.disabled;\n  var _useContext = useContext(ConfigContext),\n    getPrefixCls = _useContext.getPrefixCls;\n  var containerRef = useRef(null);\n  // ============================== Style ===============================\n  var prefixCls = getPrefixCls('wave');\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    hashId = _useStyle2[1];\n  // =============================== Wave ===============================\n  var showWave = useWave(containerRef, classNames(prefixCls, hashId));\n  // ============================== Effect ==============================\n  React.useEffect(function () {\n    var node = containerRef.current;\n    if (!node || node.nodeType !== 1 || disabled) {\n      return;\n    }\n    // Click handler\n    var onClick = function onClick(e) {\n      // Fix radio button click twice\n      if (e.target.tagName === 'INPUT' || !isVisible(e.target) ||\n      // No need wave\n      !node.getAttribute || node.getAttribute('disabled') || node.disabled || node.className.includes('disabled') || node.className.includes('-leave')) {\n        return;\n      }\n      showWave();\n    };\n    // Bind events\n    node.addEventListener('click', onClick, true);\n    return function () {\n      node.removeEventListener('click', onClick, true);\n    };\n  }, [disabled]);\n  // ============================== Render ==============================\n  if (! /*#__PURE__*/React.isValidElement(children)) {\n    return children !== null && children !== void 0 ? children : null;\n  }\n  var ref = supportRef(children) ? composeRef(children.ref, containerRef) : containerRef;\n  return cloneElement(children, {\n    ref: ref\n  });\n};\nexport default Wave;","map":{"version":3,"names":["classNames","composeRef","supportRef","isVisible","React","useContext","useRef","ConfigContext","cloneElement","useStyle","useWave","Wave","props","children","disabled","getPrefixCls","containerRef","prefixCls","hashId","showWave","useEffect","node","current","nodeType","onClick","e","target","tagName","getAttribute","className","includes","addEventListener","removeEventListener","isValidElement","ref"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/_util/wave/index.js"],"sourcesContent":["import classNames from 'classnames';\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport isVisible from \"rc-util/es/Dom/isVisible\";\nimport React, { useContext, useRef } from 'react';\nimport { ConfigContext } from '../../config-provider';\nimport { cloneElement } from '../reactNode';\nimport useStyle from './style';\nimport useWave from './useWave';\nconst Wave = props => {\n  const {\n    children,\n    disabled\n  } = props;\n  const {\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const containerRef = useRef(null);\n  // ============================== Style ===============================\n  const prefixCls = getPrefixCls('wave');\n  const [, hashId] = useStyle(prefixCls);\n  // =============================== Wave ===============================\n  const showWave = useWave(containerRef, classNames(prefixCls, hashId));\n  // ============================== Effect ==============================\n  React.useEffect(() => {\n    const node = containerRef.current;\n    if (!node || node.nodeType !== 1 || disabled) {\n      return;\n    }\n    // Click handler\n    const onClick = e => {\n      // Fix radio button click twice\n      if (e.target.tagName === 'INPUT' || !isVisible(e.target) ||\n      // No need wave\n      !node.getAttribute || node.getAttribute('disabled') || node.disabled || node.className.includes('disabled') || node.className.includes('-leave')) {\n        return;\n      }\n      showWave();\n    };\n    // Bind events\n    node.addEventListener('click', onClick, true);\n    return () => {\n      node.removeEventListener('click', onClick, true);\n    };\n  }, [disabled]);\n  // ============================== Render ==============================\n  if (! /*#__PURE__*/React.isValidElement(children)) {\n    return children !== null && children !== void 0 ? children : null;\n  }\n  const ref = supportRef(children) ? composeRef(children.ref, containerRef) : containerRef;\n  return cloneElement(children, {\n    ref\n  });\n};\nexport default Wave;"],"mappings":";AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,EAAEC,UAAU,QAAQ,gBAAgB;AACvD,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,KAAK,IAAIC,UAAU,EAAEC,MAAM,Q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